<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Dashboard">
    <meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">

    <title>Clairvoyance</title>
    <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.png">
    <!-- Bootstrap core CSS -->
    <link href="/bootstrap/dist/css/bootstrap.css" rel="stylesheet">

    <link rel="stylesheet" href="/layui/css/layui.css">
    <!--external css-->
    <link href="/css/font-awesome.css" rel="stylesheet"/>

    <!-- Custom styles for this template -->
    <link href="/css/stylenew.css" rel="stylesheet">
    <link href="/css/style-responsive.css" rel="stylesheet">
    <link href="http://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

</head>

<body>

<div id="login-page">
    <div class="container">

        <form class="form-login" id="loginform" action="##" onsubmit="return false">
            <h2 class="form-login-heading">sign in now</h2>
            <div class="login-wrap">
                <input type="text" class="form-control" lay-verify="required" name="email" placeholder="Email"
                       autofocus>
                <br>
                <input type="password" class="form-control" name="password" lay-verify="required"
                       placeholder="Password">
                <br>
                <button class="btn btn-theme btn-block" onclick="login()"><i class="fa fa-lock"></i>&nbsp;&nbsp;Login
                </button>
                <hr>

                <div class="login-social-link centered">
                    <div class="registration">
                        <a href="/register">
                            No account yet? To register
                        </a>
                    </div>
                    <br>
                    <div class="registration">
                        <a href="/index">
                            Home
                        </a>
                    </div>

                </div>
            </div>

            <!-- Modal -->
            <!-- <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title">Forgot Password ?</h4>
                        </div>
                        <div class="modal-body">
                            <p>Enter your e-mail address below to reset your password.</p>
                            <input type="text" name="email" placeholder="Email" autocomplete="off" class="form-control placeholder-no-fix">

                        </div>
                        <div class="modal-footer">
                            <button data-dismiss="modal" class="btn btn-default" type="button">Cancel</button>
                            <button class="btn btn-theme" type="button">Submit</button>
                        </div>
                    </div>
                </div>
            </div> -->
            <!-- modal -->

        </form>

    </div>
</div>

<!-- js placed at the end of the document so the pages load faster -->
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/layui/layui.all.js"></script>
<script src="/js/core.util.js"></script>
<!--BACKSTRETCH-->
<!-- You can use an image of whatever size. This script will stretch to fit in any screen size.-->
<script type="text/javascript" src="/js/jquery.backstretch.min.js"></script>
<script>
    $.backstretch(["images/bg.jpg"]);
    let layer = layui.layer;

    function login() {
        CoreUtil.sendAjax("/user/login", CoreUtil.formJson("loginform"), function (res) {
            CoreUtil.setData("access_token", res.data.accessToken);
            CoreUtil.setData("refresh_token", res.data.refreshToken);
            window.location.href = "/index";
        })

    }


</script>


</body>
</html>
